package com.luhui.codereview.actions

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.luhui.codereview.ReloadIcon
import com.luhui.codereview.getMessage
import com.luhui.codereview.swing.UserListTabTable
import com.luhui.codereview.swing.ViewTabTable

/**
 * @author  luhui
 * @date  2019/11/18 22:04
 * @version 1.0
 */
class RefreshAction(private val viewTabTable: ViewTabTable.BaseViewTabTable,
                    private val userListTabTable : UserListTabTable.BaseUserListTable) :
        AnAction(getMessage("tab.refresh.action.text"), getMessage("tab.refresh.action.description"), ReloadIcon){

    override fun actionPerformed(p0: AnActionEvent?) {
        viewTabTable.refresh()
        userListTabTable.refresh()
    }

    override fun displayTextInToolbar(): Boolean {
        return true
    }
}